const image = function(file) {
  const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';

  if (!isJpgOrPng) {
    return false
    // this.$message.error('你上传的不是图片');
  } else {
    return true
  }

};
const pdf = function(file) {
  const isPdf = file.type === 'application/pdf'
  if (!isPdf) {

    return false
    // this.$message.error('你上传的不是PDF');
  } else {
    return true
  }
}
const pageNum = function(val) {
  if (val == 0) {
    return 1
  } else {
    return val
  }
}


const default0Fn = function(val) {
  if (typeof val === 'undefined' || val === null || val.toString().trim() === '') {
    return 0
  }
  return val
}
export default {
  image,
  pdf,
  pageNum,
  default0Fn
}
